import { connect } from 'react-redux'
function Child(props) {
  let { age, addAge } = props;
  return <>
    <h2>{age}</h2>
    <button onClick={() => { addAge(11) }}>+age</button>
  </>
}
Child = connect((state) => {
  return {
    age: state.age
  }
}, (dispatch) => {
  return {
    addAge(n) {
      dispatch({ type: 'addAge', num: n })
    }
  }
})(Child)

export default Child
